<?php
namespace Home\Biz;

/**
 *
 * @author Simon
 *        
 */
class AdminBiz {
	
	public static function logout($user_id) {
		cookie('login_user_id', $user_id, array('expire'=>-1,'domain'=>C('AdminConfig.login_cookie_domain')));
	}


    /**
     * 验证请求参数中user_id和cookie中的user_id一致性
     */
    public static function verifyUser(){
        $login_user_id = cookie(C('AdminConfig.login_cookie_name'));
        $login_safecode_cookie = cookie(C('AdminConfig.login_safecode_cookie_name'));
        $safe_code = md5($login_user_id.C('SystemConfig.encrypt_key').date("y-m-d", time()));

        if($safe_code != $login_safecode_cookie){
            //安全校验错误
            return false;
        }
        else
        {
            return true;
        }
    }


	
}